package cn.edu.sdjzu.xg.kcsj.domain;

import cn.edu.sdjzu.xg.kcsj.domain.authority.Actor;
import lombok.*;
import java.io.Serializable;
@Setter
@Getter
@ToString
@NoArgsConstructor
public class Student extends Actor implements Comparable<Student>, Serializable {
    private Integer id;
    private String name;
    private String no;
    private Integer age;
    private String sex;
    private StudentClass studentClass;

    public Student(Integer id, String studentName, String studentNo,int studentAge,String studentSex,
                   StudentClass studentClass) {
        this(studentName, studentNo, studentAge,studentSex,studentClass);
        this.id = id;
    }

    public Student(String studentName, String studentNo,int studentAge,String studentSex,
                   StudentClass studentClass) {
        this(studentName, studentNo);
        this.studentClass = studentClass;
        this.age = studentAge;
        this.sex = studentSex;
    }

    public Student(String studentName, String studentNo
    ) {
        this.name = studentName;
        this.no = studentNo;
    }

    @Override
    public int compareTo(Student other) {
        // no为排序依据
        return this.no.compareTo(other.no);
    }
}
